-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor handle_return #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I have rescoped this PR to only refactor the handle_return part now, which has been done well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the return statement handling functionality in a Python-to-BPF compiler by extracting return logic into separate utility modules and improving code organization.
Key changes:
- Extracted return handling logic from
functions_pass.py
into dedicated utility modules - Enhanced expression evaluation to support binary operations and ctypes casting
- Added comprehensive test coverage for various return statement patterns
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
pythonbpf/functions/return_utils.py |
New utility module containing extracted return handling functions |
pythonbpf/functions/functions_pass.py |
Refactored to use new return handling utilities and updated imports |
pythonbpf/functions/func_registry_handlers.py |
New registry pattern for statement handlers |
pythonbpf/expr_pass.py |
Enhanced with ctypes casting and binary operation support |
pythonbpf/type_deducer.py |
Reorganized code structure and added ctypes validation function |
pythonbpf/codegen.py |
Updated import path for functions module |
tests/passing_tests/return/*.py |
Added test files covering various return scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.